<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
exit();

//
$sdirs = array('origins', 'resized', 'thumbs');

//
require(dirname(dirname(__FILE__)) . '/includes/application_top.php');

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'core.directory.class.php');
//
foreach($sdirs as $sdir) {
	echo $sdir . '/';echo '<br>';
	$dObj = new CoreDirectoryParser(CONFIG_PATH . 'images/uploads/' . $sdir . '/');
	$dObj->parse();
	$_dir = $dObj->_dir;
	$dirs = $dObj->getDirs();
	$files = $dObj->getFiles();
	//
	if( is_array($files) ) {
		foreach($files as $key => $file) {
			//if( strstr($file['file'], 'xxx') === false ) {
				@unlink($_dir . $file['file']);
			//}
		}
	}
	//
	foreach($dirs as $key => $value) {
		util_rmdir($_dir . $value);
	}
	//
	//unlink($dir);
	//rmdir($dir);
}
//
echo 'OK';
//
?>